package com.rjj.wlqq.ryAnnotationExcel.entity;

import com.rjj.wlqq.tool.excel.ry_excel.annotation.Excel;
import com.rjj.wlqq.tool.excel.ry_excel.annotation.Excels;

import java.util.Date;

/**
 * @author r
 * @date 2020/12/12 12:03
 */
public class User {
    @Excel(name = "用户序号", cellType = Excel.ColumnType.NUMERIC, prompt = "用户编号")
    private Integer id;
    @Excel(name = "用户名称", cellType = Excel.ColumnType.STRING)
    public String name;
    @Excel(name = "用户年龄", readConverterExp = "0=女,1=男")
    private Integer age;
    @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
    private Integer sex;
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private Date loginDate;
    @Excels({
            @Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.ALL)
            /* @Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.ALL)*/
    })
    private Dept dept;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Date getLoginDate() {
        return loginDate;
    }

    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }

    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", loginDate=" + loginDate +
                ", dept=" + dept +
                '}';
    }
}
